package 集合框架;



    public class Test1 {
        public static void main(String[] args) {
            int arr[] = new int[10];
            for (int i = 0; i < arr.length; i++) {
                int index = (int)(Math.random() * 10 + 1);
                arr[i] = index;
                for (int j = 0; j < i; j++) {
                    if (arr[j] == arr[i]) {
                        i--;
                        break;
                    }
                }
            }
            for (int i = 0; i < arr.length; i++) {
                System.out.print(arr[i] + " ");
            }
        }
    }

